xfree(odesc);
} else {
if (strcmp(waypointp->shortname, waypointp->description)) {
- // This is a hack. The entitizer code really should catch this,
- // but this is the low risk fix for now - just toss bad chars.
- int j;
- char* t = xstrdup(waypointp->description);
- for (j = 0; t[j] != 0; j++) {
- if (t[j] < ' ') {
- t[j] = ' ';
- }
- }
-
- kml_write_xmle("description", t);
- xfree(t);
+ kml_write_xmle("description", waypointp->description);
}
}
</wpt>
<wpt lat="37.522060037" lon="-122.277670026">
<name>NOTE 1</name>
- <cmt>12 test lines - see notes with GPX sample!!\rfour line widths for solid red\rtwo line widths for dashed red\rseven colors for medium width\rNote that line names have nothing at all to do with line style attributes!\vThese are named for convenient cross-reference,\r but keep in mind that "red med" is a line label and "Red Medium" is a style label.\rWaypoints are generated by Topo to exactly match the first track point.\rApparently only GPX and KML output from GPSBabel retain track descriptions??</cmt>
- <desc>12 test lines - see notes with GPX sample!!\rfour line widths for solid red\rtwo line widths for dashed red\rseven colors for medium width\rNote that line names have nothing at all to do with line style attributes!\vThese are named for convenient cross-reference,\r but keep in mind that "red med" is a line label and "Red Medium" is a style label.\rWaypoints are generated by Topo to exactly match the first track point.\rApparently only GPX and KML output from GPSBabel retain track descriptions??</desc>
+ <cmt>12 test lines - see notes with GPX sample!!\rfour line widths for solid red\rtwo line widths for dashed red\rseven colors for medium width\rNote that line names have nothing at all to do with line style attributes! These are named for convenient cross-reference,\r but keep in mind that "red med" is a line label and "Red Medium" is a style label.\rWaypoints are generated by Topo to exactly match the first track point.\rApparently only GPX and KML output from GPSBabel retain track descriptions??</cmt>
+ <desc>12 test lines - see notes with GPX sample!!\rfour line widths for solid red\rtwo line widths for dashed red\rseven colors for medium width\rNote that line names have nothing at all to do with line style attributes! These are named for convenient cross-reference,\r but keep in mind that "red med" is a line label and "Red Medium" is a style label.\rWaypoints are generated by Topo to exactly match the first track point.\rApparently only GPX and KML output from GPSBabel retain track descriptions??</desc>
</wpt>
<wpt lat="37.522349358" lon="-122.284910083">
<name>NOTE 2</name>
</Placemark>
<Placemark>
<name>NOTE 1</name>
- <description>12 test lines - see notes with GPX sample!! four line widths for solid red two line widths for dashed red seven colors for medium width Note that line names have nothing at all to do with line style attributes! These are named for convenient cross-reference, but keep in mind that "red med" is a line label and "Red Medium" is a style label. Waypoints are generated by Topo to exactly match the first track point. Apparently only GPX and KML output from GPSBabel retain track descriptions??</description>
+ <description>12 test lines - see notes with GPX sample!!\rfour line widths for solid red\rtwo line widths for dashed red\rseven colors for medium width\rNote that line names have nothing at all to do with line style attributes! These are named for convenient cross-reference,\r but keep in mind that "red med" is a line label and "Red Medium" is a style label.\rWaypoints are generated by Topo to exactly match the first track point.\rApparently only GPX and KML output from GPSBabel retain track descriptions??</description>
<styleUrl>#waypoint</styleUrl>
<Point>
<coordinates>-122.277670,37.522060</coordinates>
</Placemark>
<Placemark>
<name>NOTE 2</name>
- <description>how GPX from GPSBabel shows Topo track desc as of 2012: (line name and line style are NOT related to actual color or width) <trk> <name>red line</name> <desc>Style=red med, Width=3, Dashed=0, Color=#ff0000</desc> <number>1</number> <trkseg> ... (Topo menu colors are stored in the file as web-style hex RGB) Red=#ff0000, Yellow=#ffff00, Green=#008000, Blue=#000080, Purple=#800080, Black=#000000, White=#ffffff (Topo solid line widths: Hairline=1, Thin=2, Medium=3, Thick=4) (Topo dashed line widths: Hairline=1, Thin=2) SRE's tpo.c mod stuffs Style/Width/Dashed/Color fields into "desc" field under the assumption that something will post-process GPX or KML output and move information from desc to private extensions (solid lines have "Dashed=0", can have width of 1=hairline to 4=thick) (dashed lines have "Dashed=1", can only have width of 1=hairline or 2=thin) </description>
+ <description>how GPX from GPSBabel shows Topo track desc as of 2012:\r(line name and line style are NOT related to actual color or width)\r\r<trk>\r <name>red line</name>\r <desc>Style=red med, Width=3, Dashed=0, Color=#ff0000</desc>\r<number>1</number>\r<trkseg>\r...\r(Topo menu colors are stored in the file as web-style hex RGB)\r Red=#ff0000, Yellow=#ffff00, Green=#008000, Blue=#000080,\r Purple=#800080, Black=#000000, White=#ffffff\r(Topo solid line widths: Hairline=1, Thin=2, Medium=3, Thick=4)\r(Topo dashed line widths: Hairline=1, Thin=2)\rSRE's tpo.c mod stuffs Style/Width/Dashed/Color fields into "desc" field\r under the assumption that something will post-process GPX or KML output\r and move information from desc to private extensions\r(solid lines have "Dashed=0", can have width of 1=hairline to 4=thick)\r(dashed lines have "Dashed=1", can only have width of 1=hairline or 2=thin)\r</description>
<styleUrl>#waypoint</styleUrl>
<Point>
<coordinates>-122.284910,37.522349</coordinates>
</Placemark>
<Placemark>
<name>NOTE 3</name>
- <description>how KML from GPSBabel shows Topo track desc as of 2012: (see important notes with GPX sample, all of them apply here!) (note that GPSBabel forces all track styles to be the same - why?) <Folder> <name>Tracks</name> <Folder> <name>red line</name> <snippet/> <description> <![CDATA[<table> <tr><td><b>Description</b> Style=Red Medium, Width=3, Dashed=0, Color=#ff0000 </td></tr> <tr><td><b>Distance</b> 1.3 mi </td></tr> </table>]]> </description> <Folder> <name>Points</name> <Placemark> <name>red line-0</name> ...</description>
+ <description>how KML from GPSBabel shows Topo track desc as of 2012:\r(see important notes with GPX sample, all of them apply here!)\r(note that GPSBabel forces all track styles to be the same - why?)\r\r <Folder>\r <name>Tracks</name>\r <Folder>\r <name>red line</name>\r <snippet/>\r <description>\r<![CDATA[<table>\r <tr><td><b>Description</b> Style=Red Medium, Width=3, Dashed=0, Color=#ff0000 </td></tr>\r <tr><td><b>Distance</b> 1.3 mi </td></tr>\r </table>]]>\r </description>\r <Folder>\r <name>Points</name>\r <Placemark>\r <name>red line-0</name>\r...</description>
<styleUrl>#waypoint</styleUrl>
<Point>
<coordinates>-122.288962,37.522691</coordinates>
</Placemark>
<Placemark>
<name>NOTE 4</name>
- <description>how MapSource 6.16.3 adds color to a track as of 2012: (color choices are Dark Gray, Red, Green, Yellow, Blue, Magenta, Cyan, White, Transparent) (should be easy to turn desc tag into their extension, but better to directly write track styles) <trk> <name>Hwy 50 from Placerville</name> <extensions> <gpxx:TrackExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"> <gpxx:DisplayColor>Red</gpxx:DisplayColor> </gpxx:TrackExtension> </extensions> <trkseg> ... </description>
+ <description>how MapSource 6.16.3 adds color to a track as of 2012:\r(color choices are Dark Gray, Red, Green, Yellow, Blue, Magenta, Cyan, White, Transparent)\r(should be easy to turn desc tag into their extension, but better to directly write track styles)\r\r <trk>\r <name>Hwy 50 from Placerville</name>\r <extensions>\r <gpxx:TrackExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">\r <gpxx:DisplayColor>Red</gpxx:DisplayColor>\r </gpxx:TrackExtension>\r </extensions>\r <trkseg>\r...\r</description>
<styleUrl>#waypoint</styleUrl>
<Point>
<coordinates>-122.272938,37.522105</coordinates>
{ "<", "<", 0 },
{ ">", ">", 0 },
{ "\"", """, 0 },
+ { "\x01", " ", 1 }, // illegal xml 1.0 character
+ { "\x02", " ", 1 }, // illegal xml 1.0 character
+ { "\x03", " ", 1 }, // illegal xml 1.0 character
+ { "\x04", " ", 1 }, // illegal xml 1.0 character
+ { "\x05", " ", 1 }, // illegal xml 1.0 character
+ { "\x06", " ", 1 }, // illegal xml 1.0 character
+ { "\x07", " ", 1 }, // illegal xml 1.0 character
+ { "\x08", " ", 1 }, // illegal xml 1.0 character
+ // { "\x09", " ", 1 }, legal xml 1.0 character
+ // { "\x0a", " ", 1 }, legal xml 1.0 character
+ { "\x0b", " ", 1 }, // illegal xml 1.0 character
+ { "\x0c", " ", 1 }, // illegal xml 1.0 character
+ // { "\x0d", " ", 1 }, legal xml 1.0 character
+ { "\x0e", " ", 1 }, // illegal xml 1.0 character
+ { "\x0f", " ", 1 }, // illegal xml 1.0 character
+ { "\x10", " ", 1 }, // illegal xml 1.0 character
+ { "\x11", " ", 1 }, // illegal xml 1.0 character
+ { "\x12", " ", 1 }, // illegal xml 1.0 character
+ { "\x13", " ", 1 }, // illegal xml 1.0 character
+ { "\x14", " ", 1 }, // illegal xml 1.0 character
+ { "\x15", " ", 1 }, // illegal xml 1.0 character
+ { "\x16", " ", 1 }, // illegal xml 1.0 character
+ { "\x17", " ", 1 }, // illegal xml 1.0 character
+ { "\x18", " ", 1 }, // illegal xml 1.0 character
+ { "\x19", " ", 1 }, // illegal xml 1.0 character
+ { "\x1a", " ", 1 }, // illegal xml 1.0 character
+ { "\x1b", " ", 1 }, // illegal xml 1.0 character
+ { "\x1c", " ", 1 }, // illegal xml 1.0 character
+ { "\x1d", " ", 1 }, //illegal xml 1.0 character
+ { "\x1e", " ", 1 }, //illegal xml 1.0 character
+ { "\x1f", " ", 1 }, //illegal xml 1.0 character
{ NULL, NULL, 0 }
};